public class Test1 {
        public static void main(String[] args){
            Object o=new Object(){
                public boolean equals(Object obj){
                    return true;
                }
            };//匿名内部类，重写了equals方法
            System.out.println(o.equals("Fred"));
        }
}
